package com.infore.gateway.main.kafka;

import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;
import com.infore.gateway.main.constant.GatewayConstant;

/**
 * <p> 消费者 - 接收消息 </p>
 *
 * @author lijh
 * @description 监听kafka消息
 * @date 2023/11/14 11:34
 */
@Slf4j
//@Component
public class Consumer {

/*    @KafkaListener(topics = GatewayConstant.KAFKA_TOPIC_LOG)
    public void listen(ConsumerRecord<?, ?> record) {
        log.info("topic: " + record.topic() + "  <|============|>  消息内容：" + record.value());
    }*/

    @KafkaListener(topics = GatewayConstant.KAFKA_TOPIC_LOG)
    public void listen(String value) {
        log.info("消费者: " + value);
    }

}
